/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package UserPackage;

import java.security.MessageDigest;

/**
 *
 * @author RES
 */
public class Hasher {
    
    public String passHasher(String password)
    {
        String pass = password;
        try
        {
            MessageDigest md = MessageDigest.getInstance("SHA-512");
            md.update(pass.getBytes());
            
            byte byteData[] = md.digest();
            
            java.math.BigInteger number = new java.math.BigInteger(1, byteData);
            
            return String.format("%1$064x", number);
        }
        
        catch(Exception e){
            String error = "error";
            return error;
        }
        }
        
        }